//
//  LXCarDetailsTopView.m
//  ZuLinProject
//
//  Created by bancheng on 2022/9/6.
//  Copyright © 2022 LX_App. All rights reserved.
//

#import "LXCarDetailsTopView.h"

@implementation LXCarDetailsTopView

- (void)awakeFromNib{
    [super awakeFromNib];
    
    [self.backView addCorner:3];
}
- (void)setModel:(CheLiangModel *)model{
    
    _model = model;
    
    
    self.lable1.text = [NSString stringWithFormat:@"%@", model.carNum];
    self.lable2.text = [NSString stringWithFormat:@"%@ %@", model.carBrand,model.carMode];


    NSString *energyType = [Tool getId:[NSString stringWithFormat:@"%@",@(model.energyType)] DicDataWithKey:k_NYLX];
    NSString *yearStr = @"- 年";
    if (model.registerTime.length>4) {
        yearStr = [[model.registerTime substringToIndex:4] stringByAppendingString:@"年"];
    }
    self.lable3.text = [NSString stringWithFormat:@"%@丨%@丨%@公里",yearStr,energyType,model.kilometers];

    //1出租中
    if([model.hireFlag intValue] == 1){
        self.lable4.text = @"签约中";
        self.lable4.textColor = [UIColor colorWithHexString:@"#FF921C"];
        self.btn6.hidden = YES;
    }
    else{
        self.lable4.text = @"未签约";
        self.lable4.textColor = ColorWith3C6CFC;
        self.btn6.hidden = NO;
    }
    
}
@end
